package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author 赵超
 */
@RequestMapping("/agency/bank-account")
@Api(tags = "机构端 - 银行账户相关接口")
@RequiredArgsConstructor
@Slf4j
@RestController
public class AgencyBankAccount {
    private final IBankAccountService bankAccountService;

    @PostMapping
    @ApiOperation("新增银行账户")
    public void addAccount(@RequestBody BankAccountUpsertReqDTO dto) {
        dto.setType(3);
        bankAccountService.addBankAccount(dto);
    }

    @GetMapping("/currentUserBankAccount")
    @ApiOperation("获取当前用户银行卡信息")
    public BankAccountResDTO currentUserBankAccount() {
        return bankAccountService.currentUserBankAccount();
    }
}
